If there is only one table in the caseTable A:ID num1,num21 10 52 10 03 20 0Select ID, num1,num2,num1-num2 as subnum from A;In this case:The results are as follows:ID NUM1 num2 Subnum1 10 5 52 10 0 103 20 0 20In a single-table case, so that in SQL,
Mysql auto-incrementing primary key-return method bitsCN.com
Recently, it has always been a headache to initialize data for the current project, and the auto-increment of database IDs is getting bigger and bigger, so we need to re-start
Mysql versions later than 5.0.17
Mysql versions later than 5.0.17 deal with ''and null
After MySQL is upgraded to 5.0.17, execute the SQL statement
Insert INTO 'table name' () VALUES ();
Error:
#1264-Out of range value for column ''at row 1
String function string comparison function if the result length is greater than the maximum value of the max_allowed_packet system variable, the return value of the string value function is NULL. See section 7.5.2 "Adjust server Parameters ".
String
Replace, concat, and cast character string functions in mysql need to export a personal information of job-seeking users. This information requires three-table joint query requirements: birthdate format: 1990.01.02 Database: Gender display: men and
MySQL function learning NOTE 2: character Functions
1. Calculate the number of characters and length of a string-CHAR_LENGTH (s)
CHAR_LENGTH (str): Returns the number of characters contained in str.
Mysql> select CHAR_LENGTH ('mysql ');
+ -----------
For operations on the string position, the first position is marked as 1.
ASCII(str)
Returns a string.strASCII code value of the leftmost character.If
strIs a null string and returns
0. If
strYes
NULL, Return
NULL.
mysql>
String functionsstring comparison functionsIf the length of the result is greater than the maximum value of the Max_allowed_packet system variable, the return value of the string value function is null. See section 7.5.2, "Tuning server parameters."
For operations on string positions, the first position is marked as 1.
ASCII(str)
Returns the str ASCII code value of the leftmost character of the string. If
str It is an empty string, return
0 . If
str Yes
For operations on string positions, the first position is marked as 1.
ASCII(str)
Returns the str ASCII code value of the leftmost character of the string. If
str It is an empty string, return
0 . If
For operations on the string position, the first position is marked as 1.
ASCII(str)
Returns a string.strASCII code value of the leftmost character.If
strIs a null string and returns
0. If
strYes
NULL, Return
NULL.
mysql>
For operations on the string position, the first position is marked as 1.
ASCII(str)
Returns a string.strASCII code value of the leftmost character.If
strIs a null string and returns
0. If
strYes
NULL, Return
NULL.
mysql>
Mysql string function collection is more comprehensive bitsCN.com
For operations on the string position, the first position is marked as 1.
ASCII(str)
Returns a string.strASCII code value of the leftmost character.If
strIs a null
MySQL string function Daquan bitsCN.com
MySQL string functionsFor operations on the string position, the first position is marked as 1.
ASCII (str)
Returns the ASCII code value of the leftmost character of the str string. If str is a null string, 0
If a string function provides a binary string as a parameter, the result string is also a binary string. The number converted to a string is treated as a binary string. This only affects the comparison.
If a string function provides a binary string
For operations on string positions, the first position is marked as 1.
ASCII(str)
Returns the str ASCII code value of the leftmost character of the string. If
str It is an empty string, return
0 . If
For operations on string positions, the first position is marked as 1.
ASCII(str)
Returns the str ASCII code value of the leftmost character of the string. If
str It is an empty string, return
0 . If
Generally, the entire string is used as the operation object, for example: search for a substring in a substring, obtain a substring, insert a substring at a certain position in the substring, and delete a substring.
Generally, the entire string is
Excuse me, what is the best reference document? my answer is: a real and feasible sample statement.
Excuse me, what is the best reference document? my answer is: a real and feasible sample statement.
I have always adhered to one point: the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.